					
					<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
					<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
					<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
					<div class="post">
						<h2 class="title"><fmt:message key="locanet.locacoes.buscaLocacoes" /></h2>
						<form action="locacao@select.action" method="get">
							<table>
							<tr><td><fmt:message key="locanet.locacoes.codigoCopia" /></td><td><input type="text" name="entity.filme.id" value="${param['entity.filme.id'] }" /></td></tr>
							<c:if test="${isFuncionario}">
								<tr><td><fmt:message key="locanet.tipo.cliente" /></td><td>
									<select name="entity.cliente.cpf">
										<option value=""></option>
										<c:forEach items="${requestScope.clientes}" var="cliente">
											<option value="${cliente.cpf}" <c:out value="${!empty param['entity.cliente.cpf']&&cliente.cpf==param['entity.cliente.cpf']?'selected':'' }" />><c:out value="${cliente.cpf} - ${cliente.nome}" /></option>					
										</c:forEach>
									</select>
								</td></tr>
							</c:if>
							<tr><td><fmt:message key="locanet.status" /></td><td>
								<input type="radio" name="entity.statusPagamento" value="1" <c:out value="${(!empty param['entity.statusPagamento'])?param['entity.statusPagamento']==1?'checked':'':'checked'}" /> /><fmt:message key="locanet.entidades.status.devolvido" />
									<input type="radio" name="entity.statusPagamento" value="0" <c:out value="${(!empty param['entity.statusPagamento'])?param['entity.statusPagamento']==0?'checked':'':''}" />/><fmt:message key="locanet.entidades.status.pendente" />
							</td></tr>
							<tr><td><input type="submit" value="<fmt:message key="locanet.butoes.buscar" />" /></td></tr>
							</table>
							
						</form>
					</div>
					<div class="post">
						<table id="table_busca">
							<tr>
								<c:if test="${isFuncionario}"><th></th>
								<th><fmt:message key="locanet.tipo.cliente" /></th></c:if>
								<th><fmt:message key="locanet.tipo.funcionario" /></th>
								<th><fmt:message key="locanet.Filme.filme" /></th>
								<th><fmt:message key="locanet.locacoes.locacao" /></th>
								<th><fmt:message key="locanet.locacoes.devolucao" /></th>
							</tr>
							 <c:forEach items="${requestScope.entities}" var="l">
								<tr>
									<c:if test="${isFuncionario}">
										<td><c:if test="${l.statusPagamento==0}"><a href="locacao@finalizaLocacao.action?entity.id=${l.id}"><fmt:message key="locanet.locacoes.mudarDevolucao" /></a></c:if></td>
										<td><c:out value="${l.cliente.nome}"/></td>
									</c:if>
									<td><c:out escapeXml="false" default="<b><i>Internet</i></b>" value="${l.funcionario.nome}"/></td>
									<td><a href="filme@view.action?entity.id=${ l.filme.filme.id }"><c:out value="${l.filme.id} - ${l.filme.filme.titulo}"/></a></td>
									<td><fmt:formatDate  value="${l.dataLocacao}" pattern="dd/MM/yyyy"/></td>
									<td>
										<c:if test="${l.statusPagamento==1}"><font style="color:green"><fmt:formatDate  value="${l.dataLocacao}" pattern="dd/MM/yyyy"/></font></c:if>
										<c:if test="${l.statusPagamento==0 }"><font style="color:red"><fmt:message key="locanet.entidades.status.pendente" /></font></c:if>
									</td>
								</tr>
							</c:forEach>
							<tr><td colspan="100%" style="text-align:center">
						    	<c:out value="${requestScope.totalPagingResults}" /><fmt:message key="locanet.entidades.lista.resultados.achado"/><br/>
							    <div class="pagination"><c:forEach begin="1" end="${requestScope.totalPagingResults/10+((requestScope.totalPagingResults%10!=0)?1:0)}" var="cont">
							    	<a <c:if test="${ empty param.page&&cont==1||!empty param.page&&param.page==cont }">class="current"</c:if> href="locacao@select.action?entity.id=${param['entity.id']}&entity.cliente.cpf=${param['entity.cliente.cpf']}&entity.filme.id=${param['entity.filme.id']}&page=${cont}"><c:out value="${cont}" /></a>
							    </c:forEach></div>
						    </td></tr>
						</table>
					</div>
